<?php

class Corner_Controller extends Template_Controller {



	public $template = 'client/index_corner';

	

    public function __construct()

    {

        parent::__construct();


    }

    

	public function __call($method, $arguments)

	{

		// Disable auto-rendering

		$this->auto_render = FALSE;

	}

	

    public function index()

    {	

		$this->template->content = new View('corner/index');

		$model = new Corner_description_Model();
		$this->db->where('corner_id','1');
		$mlist = $model->get_with_active($this->get_client_lang());
		$this->template->content->description = @$mlist[0]['corner_description'];

    }
	 public function detail($type='',$id='')

    {	

		$this->template->content = new View('corner/detail');
		$modelcorner = new Corner_Model();    	

    	$cornerlist = $modelcorner->get_with_list($this->get_client_lang(), $type);
		if(empty($id)) $id=@$cornerlist[0]['corner_id'];
		
		$model = new Corner_Model(); 
		$this->db->where('corner.corner_id',$id);   	
		$mlist = $model->get_with_active($this->get_client_lang());
		//echo $id;
		$model_image = new Corner_image_Model();    	
		$this->db->where('corner_images.corner_id',$id);
    	$mlistImage = $model_image->get_with_active($id);
		
		$this->template->content->cornerlist = $cornerlist;
		$this->template->content->mlist = @$mlist[0];
		$this->template->content->mlistimage = $mlistImage;
			

    }
	/* public function detail($type='',$id='')

    {	

		$this->template->content = new View('corner/detail');
		
		$modelcorner = new Corner_Model();    	

    	$cornerlist = $modelcorner->get_with_list($this->get_client_lang(), $type);
		
		if(empty($id)) $id=$cornerlist[0]['corner_id'];
		
		$model = new Corner_Model(); 
		$this->db->where('corner.corner_id',$id);   	
		$mlist = $model->get_with_active($this->get_client_lang());
		
		$model_image = new Corner_image_Model();    	

    	$mlistImage = $model_image->get($id);
		
		$this->template->content->cornerlist = $cornerlist;
		$this->template->content->mlist = $mlist[0];
		$this->template->content->mlistimage = $mlistImage;
			

    }*/
   

}

?>